Skip to content

drivers: Standardize reset method naming.#143

Merged
nedseb merged 5 commits intomainfrom
fix/standardize-reset
Mar 15, 2026
Merged

drivers: Standardize reset method naming.#143
nedseb merged 5 commits intomainfrom
fix/standardize-reset

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 15, 2026

Closes #78

Summary

Standardize reset method naming across all drivers:

  • reset() — hardware reset (pin toggle)
  • soft_reset() — software reset (register write)
  • reboot() — memory reboot (reload trimming)

Changes

Driver Before After
wsen-hids reboot_memory() reboot()
ism330dl reset() (SW reset) soft_reset()

Final state

Driver reset() soft_reset() reboot()
apds9960
bq27441 soft_reset()
hts221
ism330dl soft_reset()
lis2mdl soft_reset() reboot()
mcp23009e reset() (HW) _soft_reset() (private)
ssd1327 reset() (HW)
vl53l1x reset() (HW)
wsen-hids reboot()
wsen-pads soft_reset() reboot()

Sub-issues (missing capabilities to add)

Also updated README with the reset naming convention.

Test plan

python3 -m pytest tests/ -k "(wsen-hids or ism330dl) and mock" -v  # 39 passed

@nedseb nedseb force-pushed the fix/standardize-reset branch from e2acdba to deb4755 Compare March 15, 2026 09:38
@nedseb nedseb requested a review from Copilot March 15, 2026 09:41
@nedseb nedseb self-assigned this Mar 15, 2026
@nedseb nedseb added the enhancement New feature or request label Mar 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes reset-related method naming across drivers to align with a consistent public API (reset() for HW pin toggle, soft_reset() for SW register reset, reboot() for trimming/memory reload), and updates impacted tests/examples/docs accordingly.

Changes:

  • Rename WSEN-HIDS reboot_memory()reboot() and update the WSEN-HIDS full-test example.
  • Rename ISM330DL software reset()soft_reset() and update the ISM330DL mock scenario.
  • Document the reset naming convention in the root README.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/scenarios/ism330dl.yaml Updates scenario script to call dev.soft_reset() instead of dev.reset().
lib/wsen-hids/wsen_hids/device.py Renames driver API method to reboot().
lib/wsen-hids/examples/full_test.py Updates example test function and call site to use reboot().
lib/ism330dl/ism330dl/device.py Renames SW reset method to soft_reset() and updates constructor call.
README.md Adds a documented reset-method naming convention.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread tests/scenarios/ism330dl.yaml Outdated
Comment on lines +288 to +292
@@ -289,7 +289,7 @@ tests:
action: script
script: |
i2c.clear_write_log()
dev.reset()
dev.soft_reset()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 39b0ff3: test renamed to "Soft reset sets BDU and IF_INC in CTRL3_C" and section header updated.

Comment thread lib/ism330dl/ism330dl/device.py Outdated
@nedseb nedseb merged commit 8c5600f into main Mar 15, 2026
5 checks passed
@nedseb nedseb deleted the fix/standardize-reset branch March 15, 2026 11:02
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drivers: Standardize reset method naming.

2 participants